package 设计模式.职责链模式;

public class DepartmentApprover extends Approver{
    public DepartmentApprover(String name) {
        super(name);
    }

    @Override
    void processRequest(PurchaseRequest request) {
        if (request.getPrice() <= 5000) {
            System.out.printf("编号id:%d 被%s处理 价格:%s%n", request.getId(), this.getName(), request.getPrice());
        } else {
            //交给下一个处理者
            approver.processRequest(request);
        }
    }
}
